<?php


namespace app\api\model;


use think\Model;

class HealthClassifyModel extends Model
{

    // 表名
    protected $name = 'health_classify';

    protected $append = ['son_list'];

    public function getSonListAttr($val,$data)
    {
        if($data['pid'] == 0){
            $list = Self::all(['pid'=>$data['id'],'is_show'=>1]);
        }else{
            $list = [];
        }
        return $list;
    }

}